﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yun.Interface;
using Yun.Response;
using Yun.Util;

namespace Yun.Marketing.Request
{
    /// <summary>
    /// 添加商品专题
    /// yun.goods.subject.add
    /// </summary>
    public class AddSubjectRequest : ITopRequest<IntResultResponse>
    {
        public string GetApiName()
        {
            return "yun.goods.subject.add";
        }
        /// <summary>
        /// 专题标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 专题副标题
        /// </summary>
        public string OtherTitle { get; set; } = "";

        /// <summary>
        /// 专题图片
        /// </summary>
        public string ImgUrl { get; set; } = "";

        /// <summary>
        /// 专题描述
        /// </summary>
        public string About { get; set; } = "";

        /// <summary>
        /// 报名须知
        /// </summary>
        public string ApplyTxt { get; set; } = "";

        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime { get; set; }
         
        /// <summary>
        /// 排序号
        /// </summary>
        public int SortId { get; set; } = 0;

        /// <summary>
        /// 是否显示0-显示，1-不显示
        /// </summary>
        public int IsShow { get; set; } = 0;

        /// <summary>
        /// 自定义推荐
        /// </summary>
        public int Recommend { get; set; } = 0;

        /// <summary>
        /// 公司ID
        /// </summary>
        public int? CompanyId { get; set; }

        /// <summary>
        /// 店铺id
        /// </summary>
        public int? ShopId { get; set; }


        public void Validate()
        {
            RequestValidator.ValidateRequired("title", Title);
            RequestValidator.ValidateRequired("starttime", StartTime);
            RequestValidator.ValidateRequired("endtime", EndTime);
        }

        public IDictionary<string, string> GetParameters()
        {
            var parameters = new YunDictionary
            {
                {"title", Title},
                {"othertitle", OtherTitle},
                {"imgurl", ImgUrl},
                {"about", About},
                {"applytxt", ApplyTxt},
                {"starttime", StartTime},
                {"endtime", EndTime}, 
                {"sortid", SortId},
                {"isshow", IsShow},
                {"recommend", Recommend},
                {"companyid", CompanyId},
                {"shopid", ShopId}

            };
            return parameters;
        }

    }
}
